u"""
OverFish CMS

Created on: Jul 7, 2011 2:08:27 PM

@author: Tomas Holub (tomas.holub@olc.cz)
@package: OverFishCMS

Model validation exception
u"""

from overfish.libs.ModelException import ModelException

class ModelValidationException(ModelException):
    u"""
    Model validation exception
    """
    def __init__(self, message, collection, field):
        ModelException.__init__(self, message, collection)
        
        self.field = field
    
    def __unicode__(self):
        return self.__str__()
    
    def __str__(self):
        return u"".join((u"Validation error on field: ", self.field, u" in collection: ", self.collection.name, u" with message: ", self.message))
    